<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/JSON_2.0.4.asp"-->
<!--#include file="lib/JSON_UTIL.asp"-->
<%
Dim conn,start_time
start_time=timer()
Set conn = Server.CreateObject("ADODB.CONNECTION")
db = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=rainbow_3_0; User=root;Password=admin;Option=3;"
conn.Open db


groupid=request("groupid")
if groupid="" then
  sql="select groupid as id,groupname as name,1 as isParent from rgroup where rgr_groupid is null"
else
  sql="select groupid as id,groupname as name,1 as isParent from rgroup where rgr_groupid = "&groupid
end if
QueryToJSON(conn,sql).Flush

conn.close
set conn=nothing

%>
